package com.r2coding.auth.feign;

import com.r2coding.auth.vo.PermissionVo;
import com.r2coding.auth.vo.UserVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.List;

/**
 * @author:98k灬
 * @since:2022/04/09 11:57
 **/
@FeignClient("blog-system")
public interface UserFeignService {
    // 根据用户名查询用户信息
    @GetMapping("/api/user/getByUserName/{userName}")
    UserVo getByUserName(@PathVariable("userName") String userName);

    // 根据用户id查询该用户拥有的权限信息
    @GetMapping("/api/user/getPermissionsByUserId/{userId}")
    List<PermissionVo> getPermissionsByUserId(@PathVariable("userId") Integer userId);
}
